// Copyright © SixtyFPS GmbH <info@slint.dev>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0

InheritFlickable := Flickable {}

TestCase := Window {
    width: 500phx;
    height: 500phx;

    Flickable {
        r1 := Rectangle {
            property<bool> ok: height == root.height && width == root.width;
        }
    }

    InheritFlickable {
        width: 123phx;
        viewport_height: 456phx;
        r2 := Rectangle {
            property<bool> ok: height == 456phx && width == 123phx;
        }
    }

    f3 := InheritFlickable {
        VerticalLayout {
            spacing: 0phx;
            padding: 0phx;
            r3 := Rectangle {
                property<bool> ok: height == root.height/2 && width == 888phx && f3.viewport_width == 888phx && f3.min-width == 0phx;
            }
            Rectangle {
                min-width: 888phx;
            }
        }
    }

    f4 := Flickable {
         HorizontalLayout {
            spacing: 0phx;
            padding: 0phx;
            r4 := Rectangle {
                property<bool> ok: f4.max-height == 6000phx && r4.height == root.height;
            }
            Rectangle {
                max-height: 6000phx;
            }
        }
    }

    Flickable { for i in 5: Rectangle {} }

    property<bool> all_ok: r1.ok && r2.ok && r3.ok && r4.ok;
    property<bool> test: all_ok;
}

/*
```cpp
auto handle = TestCase::create();
const TestCase &instance = *handle;
slint_testing::send_mouse_click(&instance, 5., 5.);

assert(instance.get_all_ok());
```


```rust
let instance = TestCase::new().unwrap();
slint_testing::send_mouse_click(&instance, 5., 5.);
assert!(instance.get_all_ok());
```

```js
var instance = new slint.TestCase();
slintlib.private_api.send_mouse_click(instance, 5., 5.);
assert(instance.all_ok);
```
*/
